b394632646f7860f53daaba904d7cf035a470ed8,src/main/java/org/basex/BaseX.java,BaseX,parseArguments,#String[]#,130
Before Change
query = arg.remaining();
} else if(c == 'r') {
// hidden option: parse number of runs
arg.check(set(Prop.RUNS, arg.string()));
} else if(c == 's') {
// set/add serialization parameter
if(serial.length() != 0) serial.append(',');
serial.append(arg.string());
arg.check(set(Prop.SERIALIZER, serial));
} else if(c == 'u') {
// activate write-back for updates
arg.check(set(Prop.WRITEBACK, true));
} else if(c == 'U' && !sa()) {
// specify user name
user = arg.string();
} else if(c == 'v') {
// show command info
verbose = true;
} else if(c == 'V') {
// show query info
verbose = true;
arg.check(set(Prop.QUERYINFO, true));
} else if(c == 'w') {
// activate write-back for updates
arg.check(set(Prop.CHOP, false));
} else if(c == 'W') {
// hidden option: write properties before exit
writeProps = true;
} else if(c == 'x' && sa()) {
// hidden option: show original query plan
arg.check(set(Prop.COMPPLAN, false));
} else if(c == 'X') {
// hidden option: show xml query plan
arg.check(set(Prop.XMLPLAN, true));
verbose = true;
} else if(c == 'z') {
// turn off result serialization
arg.check(set(Prop.SERIALIZE, false));
} else {
arg.check(false);
}
After Change
final StringBuilder bind = new StringBuilder();
try {
final HashMap<Object[], Object> options = new HashMap<Object[], Object>();
final Args arg = new Args(args, this, sa() ? LOCALINFO : CLIENTINFO,
Util.info(CONSOLE, sa() ? LOCALMODE : CLIENTMODE));
while(arg.more()) {
if(arg.dash()) {
final char c = arg.next();
if(c == 'b') {
// set/add variable binding
if(bind.length() != 0) bind.append(',');
bind.append(arg.string());
options.put(Prop.BINDINGS, bind);
} else if(c == 'c') {
// specify command to be evaluated
commands = arg.remaining();
} else if(c == 'd') {
// activate debug mode
context.mprop.set(MainProp.DEBUG, true);
} else if(c == 'D' && sa()) {
// hidden option: show dot query graph
options.put(Prop.DOTPLAN, true);
} else if(c == 'i' && sa()) {
// open initial file or database
input = arg.string();
} else if(c == 'n' && !sa()) {
// set server name
context.mprop.set(MainProp.HOST, arg.string());
} else if(c == 'o') {
// specify file for result output
out = new PrintOutput(arg.string());
if(session != null) session.setOutputStream(out);
} else if(c == 'p' && !sa()) {
// set server port
context.mprop.set(MainProp.PORT, arg.num());
} else if(c == 'P' && !sa()) {
// specify password
pass = arg.string();
} else if(c == 'q') {
// specify query to be evaluated
query = arg.remaining();
} else if(c == 'r') {
// hidden option: parse number of runs
options.put(Prop.RUNS, arg.string());
} else if(c == 's') {
// set/add serialization parameter
if(serial.length() != 0) serial.append(',');
serial.append(arg.string());
options.put(Prop.SERIALIZER, serial);
} else if(c == 'u') {
// activate write-back for updates
options.put(Prop.WRITEBACK, true);
} else if(c == 'U' && !sa()) {
// specify user name
user = arg.string();
} else if(c == 'v') {
// show command info
verbose = true;
} else if(c == 'V') {
// show query info
verbose = true;
options.put(Prop.QUERYINFO, true);
} else if(c == 'w') {
// activate write-back for updates
options.put(Prop.CHOP, false);
} else if(c == 'W') {
// hidden option: write properties before exit
writeProps = true;
} else if(c == 'x' && sa()) {
// hidden option: show original query plan
options.put(Prop.COMPPLAN, false);
} else if(c == 'X') {
// hidden option: show xml query plan
options.put(Prop.XMLPLAN, true);
verbose = true;
} else if(c == 'z') {
// turn off result serialization
options.put(Prop.SERIALIZE, false);
} else {
arg.ok(false);
}